<?php


namespace app\common\model;

class CardTimeType
{
	const Minute = [0, "分钟"];
	const Hour = [1, "小时"];
	const Day = [2, "天"];
	const Week = [3, "周"];
	const Month = [4, "月"];
	const Quarter = [7, "季度"];
	const HalfYear = [8, "半年"];
	const Year = [5, "年"];
	const Perpetual = [6, "永久"];
	public static function ClearCache()
	{
		$objClass = new \ReflectionClass("app\\common\\model\\CardTimeType");
		$arrConst = $objClass->getConstants();
		return $arrConst;
		$consts = $arrConst;
		foreach ($consts as $k => $v) {
			print_r($v);
		}
	}
	public static function getName($id)
	{
		foreach (self::ClearCache() as $k => $v) {
			if ($id == $v[0]) {
				return $v[1];
			}
		}
		return null;
	}
	public static function getAllName($id)
	{
		$arr = [];
		foreach (self::ClearCache() as $k => $v) {
			$arr[] = $v[1];
		}
		return null;
	}
	public static function getAllValue()
	{
		$arr = [];
		foreach (self::ClearCache() as $k => $v) {
			$arr[] = $v[0];
		}
		return $arr;
	}
}